﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VBACodeingTool
{
    public class CodeLoaderHelper
    {
        private static LoaderModule loaderModule = null;
        public static List<ProjectCodeData> GetCurrentModuleProjectData()
        {
            string codeContent = VBEHelper.GetMultiLineString(1,VBEHelper.GetCurrentCodeModule().CountOfLines);
            if (loaderModule == null)
            {
                loaderModule  = new LoaderModule(codeContent, "module1");
            }
            else
            {
                loaderModule.CodeContent = codeContent;
                loaderModule.projectCodeData.Clear();
            }
            return loaderModule.ParseCode();
        }
    }
}
